<?php
  if ($_FILES["file"]["error"] > 0)
  {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
  }
  else
  {
      echo "Upload: " . $_FILES["file"]["name"] . "<br />";
      echo "Type: " . $_FILES["file"]["type"] . "<br />";
      echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
      echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

    $file = $_FILES['file'];
      // 判断文件是否上传
      if (is_uploaded_file($file['tmp_name'])){
          // 上传文件
          if (move_uploaded_file($file['tmp_name'],'./upload/'.$file['name'])){
              echo "文件上传成功"."<br />";
          }else{
              echo "文件已上传，但是移动时出现错误"."<br />";;
          }
      }else{
          echo '上传文件失败'."<br />";;
      }

  }
$time = (microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']);
echo "php脚本处理时间:".$time.'<br/>';
?>
